#include "requestidgenerator.h"

RequestIDGenerator* RequestIDGenerator::m_instance = 0;
QMutex RequestIDGenerator::m_mutex;

RequestIDGenerator::RequestIDGenerator()
{
    m_globeRequestID = 0;
}

RequestIDGenerator::~RequestIDGenerator()
{
    m_globeRequestID = 0;
}

unsigned int RequestIDGenerator::getGlobeRequestID()
{
    QMutexLocker locker(&m_mutex);
    if(m_globeRequestID == 0xffffffff)
    {
        m_globeRequestID = 0;
    }

    ++m_globeRequestID;
    return m_globeRequestID;
}
